<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
 

<div style="padding:10px;">
	<script type="text/javascript">
	
	function formatterDate(value,row,index){
		if(value==''||null==value){
			return '';
		}
		var now = new Date(value);  
		var year=now.getYear()+1900; 
		var month=now.getMonth()+1; 
		var date=now.getDate(); 
		var hour=now.getHours(); 
		var minute=now.getMinutes();
		minute= (minute > 9) ? minute=minute : minute='0'+minute;
		//var second=now.getSeconds(); 
		return year+"-"+month+"-"+date+" "+hour+":"+minute; 
	}
	
	function formatterId(value,row,index) {
		var cPIDSerial = row.cPIDSerial;
		
		
		 return "<a href=# onclick=showCustomer(\'"+cPIDSerial+"\')>查看测量数据</a>"+"&nbsp;&nbsp;&nbsp;&nbsp;"; 
	
	}
	
	function showCustomer(pcode){ 
	    var parent$ = self.parent.$;      //找到父级DOM  
	 
	    	var text =pcode+"测量数据";
	        var url="page.customerdata.ashx?pcode="+pcode;
			if (parent$("#tabs").tabs('exists', text)) {
				parent$('#tabs').tabs('select', text);
			} else {
				var content = '<div style="width:100%;height:100%;overflow:hidden;">'
						+ '<iframe src="'
						+ url
						+ '" scrolling="auto" style="width:100%;height:100%;border:0;" ></iframe></div>';

					parent$('#tabs').tabs('add', {
					title : text,
					content : content,
					closable : true
				});
			}
	    }
	</script>
			
			<table class="easyui-datagrid" fit=false, style="height:206px;"
			data-options="pagination:true,pageList: [5],singleSelect:true,collapsible:true,url:'${pageContext.request.contextPath}/contract/page.list.ashx'">
		<thead>
			<tr>
				<th data-options="field:'cPIDSerial',width:200">项目代码</th>
				<th data-options="field:'cPName',width:200">项目名称</th>
				<th data-options="field:'v_creatorName',width:200">创建人</th>
				<th data-options="field:'cPIDContract',width:200,formatter:formatterId">操作</th>
				 
				
			</tr>
		</thead>
	</table>
</div>